<template>
<div style="background-color: #fafafa; position: relative;display: flex;flex-direction: column; align-items: center;">
  <div class="download_Modular"
       :default-active="index"
       @open="handlerOpen"
       @close="handlerClose">
  <span class="download_Title" index="1" @click="downitem"></span>
  <div class="download_Modular_Content" style="width: 100%">
    <div class="down_Box_Down">
      <div class="download_Content_Item_Down  content_Item_Down">
        <div class="content_Item_Name">
          <img src="http://rzico-weex.oss-cn-hangzhou.aliyuncs.com/portal/download/rzico.png" style="width: 50px; padding: 5px;">
          <div class="content_Title_Text">芸助手（手机版）</div>
        </div>
        <div class="modular_Box">
          <div class="modular_Box_One">
            <span class="content_Item_Text">软件版本：2.0</span>
            <span class="content_Item_Text"style="margin-bottom: 10px">软件大小: 57M</span>
            <el-row>

                <el-button type="primary" style=" font-size: 12px; width: 80px; padding: 0; padding-top: 10px; padding-bottom: 10px;" round @click="downloadApp"> 点击下载</el-button>

            </el-row>
            <span class="content_Title_Date">2021-08-20</span>
          </div>
          <div class="modular_Box_Two">
            <span class="box_Title_Text">芸助手移动版：</span>
            <p class="box_Content_Text">芸助手--帮助实体商家快速搭建线上商城，网上开店营销，获取订单，让生意转起来，帮助提升转发率，让更多的人认识您!</p>
          </div>
        </div>
      </div>
    </div>

    <div class="down_Box_Up">
    <div class="download_Content_Item_Up">
      <div class="content_Item_Name">
        <img src="http://rzico-weex.oss-cn-hangzhou.aliyuncs.com/portal/download/rzico.png" style="width: 50px; padding: 5px;">
        <div class="content_Title_Text">芸助手（收银版）</div>
      </div>
      <div class="modular_Box">
        <div class="modular_Box_One">
          <span class="content_Item_Text">软件版本：5.2</span>
          <span class="content_Item_Text" style="margin-bottom: 10px">软件大小: 57M</span>
          <el-row>

              <el-button type="primary" style=" font-size: 12px; width: 80px; padding: 0; padding-top: 10px; padding-bottom: 10px;" round  @click="downloadPos">点击下载</el-button>
          </el-row>
          <span class="content_Title_Date">2021-06-06</span>
        </div>
        <div class="modular_Box_Two">
          <span class="box_Title_Text">芸助手收银版：</span>
          <p class="box_Content_Text">芸助手--专门针对各个行业的门店收银系统、使用本系统可以实现经营场所的信息化管理实现生意。</p>
        </div>
      </div>
    </div>
    </div>
  </div>

  </div>

  <div class="maskBox" id="mask"  v-if="isMask" @click="closeMask()">
    <div class="mask">
      <div class="mask-sign">
        <span id="span">{{maskTitle}}</span>
        <img class="mask-sign-imgBox" src="@/assets/mask.png"></img>
      </div>
    </div>
  </div>

</div>
</template>

<script>
export default {
  name: 'downloadCenter',

  data(){
    return{
      index:'0',
      maskTitle:'请在浏览器中打开...',
      isMask:false
    }
  },
  props:[
    'indexBottom'
  ],
  created() {
    console.log(this.indexBottom)
    console.log('下载')
    this.index = this.indexBottom
  },
  methods: {
    handlerOpen(data){
      console.log(data)
    },
    handlerClose(){

    },
    downitem(data){
      console.log(data)
      this.index = data.index
    },
    //判断是否是微信浏览器的函数
    isWeiXin(){
      //window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息，这个属性可以用来判断浏览器类型
      var ua = window.navigator.userAgent.toLowerCase();
      //通过正则表达式匹配ua中是否含有MicroMessenger字符串
      if(ua.match(/MicroMessenger/i) == 'micromessenger'){
        return true;
      } else{
        return false;
      }
    },
    closeMask() {
      this.isMask = false;
    },
    downloadApp() {
      if (this.isWeiXin()) {
        //userAgent 属性是一个只读的字符串，声明了浏览器用于 HTTP 请求的用户代理头的值
        var u = window.navigator.userAgent;
        //Android终端
        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
        //iOS终端
        var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        if (isAndroid) {
          this.maskTitle = "点击“…”在浏览器打开";
        }
        if (isiOS) {
          this.maskTitle = "点击“…”在Safari浏览器打开";
        }
        this.isMask = true;
      } else {
        window.location.href = "http://cdn.rzico.com/vbox/vbox-v3.0-release.apk"
      }
    },
    downloadPos() {
      if (this.isWeiXin()) {
        //userAgent 属性是一个只读的字符串，声明了浏览器用于 HTTP 请求的用户代理头的值
        var u = window.navigator.userAgent;
        //Android终端
        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
        //iOS终端
        var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        if (isAndroid) {
          this.maskTitle = "点击“…”在浏览器打开";
        }
        if (isiOS) {
          this.maskTitle = "点击“…”在Safari浏览器打开";
        }
        this.isMask = true;
      } else {
        window.location.href = "http://cdn.rzico.com/epos/epos-1.7-release.apk"
      }
    },

  }
}

</script>

<style>
.download_Bottom_Remind {
  color: #adadad;
  margin-top: 20px;
  font-size: 15px;
  font-weight: 500;
}
.box_Content_Text {


  text-align: justify;
}

p{
  margin: 0;
  padding: 0;
}


.mask{
  position: fixed;
  top:0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0,0,0,0.7);
  /*z-index: 99999;*/
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}
.mask-sign-imgBox{
  width:70px;
  height:70px;
}
.mask-sign span{
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  margin-top: 20px;
  display: inline-block;
  letter-spacing: 1.25px;
  text-align: right;
  color: #ffffff;
}
.mask-sign{
  position: absolute;
  right: 0;
  top:0;
  padding-top: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
}


@media screen and (min-width: 0px) and (max-width: 350px) {

  .download_Modular {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100vw;
    height: 100vh;
    padding: 10px 20px 20px 20px;
    margin-bottom: 70px;
  }

  .download_Title {
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    padding: 20px;
  }

  .down_Box_Up {
    background-color: #FFFFFF;
    display: flex;
    justify-content: center;
    width: 100%;
    height: auto;
  }

  .down_Box_Down {
    background-color: rgb(237 237 237);
    display: flex;
    justify-content: center;
    width: 100%;
    height: auto;
  }
  .download_Content_Item_Up {
    background-color: #FFFFFF;
    width: 100%;
    height: auto;
    padding:20px;
  }

  .download_Content_Item_Down {
    background-color: rgb(237 237 237);
    width: 100%;
    height: auto;
    padding:20px;
  }
  .content_Item_Name {
    width: 200px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }
  .content_Title_Text{
    color: #0096ff;
    font-size: 15px;
    /*margin-left: 40px;*/
    font-weight: 700;
    padding: 5px;
  }
  .modular_Box {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
  .modular_Box_One {
    width: auto;
    /*height: 100px;*/
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-right: 20px;
  }
  .content_Item_Text {
    font-size: 12px;
    color: #808080;
    font-weight: 500;
    margin: 10px;
  }
  .content_Title_Date {
    font-size: 12px;
    color: #adadad;
    font-weight: 500;
    margin: 5px 0;
  }
  .modular_Box_Two {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 250px;
    height: auto;
  }
  .box_Title_Text {
    font-size: 13px;
    color: #808080;
    font-weight: 600;
    margin: 10px 0;
  }
  .box_Content_Text {
    font-size: 12px;
    text-indent: 2em;
    color: #adadad;
    font-weight: 500;
    line-height: 17px;
  }
  .down_Separate {
    font-size: 12px;
  }
}

@media screen and (min-width: 351px) and (max-width: 750px) {

  .download_Modular {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 75vh;
    width: 100vw;
    /*height: 100vh;*/
    /*padding-bottom: 50px;*/
    padding: 0 20px;
    margin-bottom: 50px;
  }

  .download_Title {
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    padding: 20px;
  }

  .down_Box_Up {
    background-color: #FFFFFF;
    display: flex;
    justify-content: center;
    width: 100%;
    height: auto;
  }

  .download_Content_Item_Up {
    background-color: #FFFFFF;
    width: 100%;
    height: auto;
    padding:20px;
  }

  .down_Box_Down {
    background-color: rgb(237 237 237);
    display: flex;
    justify-content: center;
    width: auto;
    height: auto;
  }

  .download_Content_Item_Down {
    background-color: rgb(237 237 237);
    width: 100%;
    height: auto;
    padding:20px;
  }
  .down_Button {
    margin-top: 10px;
  }
  .content_Item_Name {
    width: 200px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }
  .content_Title_Text{
    color: #0096ff;
    font-size: 15px;
    /*margin-left: 40px;*/
    font-weight: 500;
    padding: 5px;
  }
  .modular_Box {
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }
  .modular_Box_One {
    width: auto;
    /*height: 150px;*/
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-right: 20px;
    margin-right: 20px;
  }
  .content_Item_Text {
    font-size: 12px;
    color: #808080;
    font-weight: 500;
    margin-top: 10px;
  }
  .content_Title_Date {
    font-size: 12px;
    color: #adadad;
    font-weight: 500;
    margin: 10px 0;
  }
  .modular_Box_Two {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 250px;
    height: auto;
  }
  .box_Title_Text {
    font-size: 13px;
    color: #808080;
    font-weight: 600;
    margin: 10px 0;
  }
  .box_Content_Text {
    font-size: 12px;
    text-indent: 2em;
    color: #adadad;
    font-weight: 500;
    line-height: 17px;
  }
}

@media screen and (min-width: 751px) and (max-width: 1199px) {

  .download_Modular {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
    width: 90vw;
    height: 100vh;
    padding-bottom: 50px;
  }

  .download_Title {
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    padding: 20px;
  }

  .down_Box_Up {
    background-color: #FFFFFF;
    display: flex;
    justify-content: center;
    width: 100%;
    height: auto;
  }

  .download_Content_Item_Up {
    background-color: #FFFFFF;
    width: auto;
    height: auto;
    padding:30px;
  }

  .down_Box_Down {
    background-color: rgb(237 237 237);
    display: flex;
    justify-content: center;
    width: auto;
    height: auto;
  }

  .download_Content_Item_Down {
    background-color: rgb(237 237 237);
    width: auto;
    height: auto;
    padding:30px;
  }
  .content_Item_Name {
    width: 200px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 30px;
  }
  .content_Title_Text{
    color: #0096ff;
    font-size: 15px;
    /*margin-left: 40px;*/
    font-weight: 700;
    padding: 5px;
  }
  .modular_Box {
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }
  .modular_Box_One {
    width: auto;
    /*height: 150px;*/
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-right: 30px;
    margin-right: 20px;
  }
  .content_Item_Text {
    font-size: 12px;
    color: #808080;
    font-weight: 500;
    margin: 10px;
  }
  .content_Title_Date {
    font-size: 12px;
    color: #adadad;
    font-weight: 500;
    margin: 10px;
  }
  .modular_Box_Two {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 250px;
    height: 150px;
  }
  .box_Title_Text {
    font-size: 15px;
    color: #808080;
    font-weight: 600;
    margin: 10px 0;
  }
  .box_Content_Text {
    font-size: 13px;
    text-indent: 2em;
    color: #adadad;
    font-weight: 500;
    line-height: 17px;
  }
}


@media screen and (min-width: 1200px) {

  .download_Modular {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
    width: 1200px;
    height: 100vh;
    padding-bottom: 50px;
  }

  .download_Title {
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    padding: 20px;
  }

  .down_Box_Up {
    background-color: #FFFFFF;
    display: flex;
    justify-content: center;
    width: 1200px;
    height: auto;
  }

  .download_Content_Item_Up {
    background-color: #FFFFFF;
    width: auto;
    height: auto;
   padding:30px;
  }

  .down_Box_Down {
    display: flex;
    justify-content: center;
    background-color: rgb(237 237 237);
    width: 1200px;
    height: auto;
  }

  .download_Content_Item_Down {
    background-color: rgb(237 237 237);
    width: auto;
    height: auto;
    padding:30px;
  }
  .content_Item_Name {
    width: 200px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 30px;
  }
  .content_Title_Text{
    color: #0096ff;
    font-size: 15px;
    /*margin-left: 40px;*/
    font-weight: 700;
    padding: 5px;
  }
  .modular_Box {
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }
  .modular_Box_One {
    width: auto;
    /*height: 150px;*/
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-right: 30px;

    margin-right: 20px;
  }
  .content_Item_Text {
    font-size: 12px;
    color: #808080;
    font-weight: 500;
    margin: 10px;
  }
  .content_Item_Img {
    height: 150px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .content_Title_Date {
    font-size: 12px;
    color: #adadad;
    font-weight: 500;
    margin: 10px;
  }
  .modular_Box_Two {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 250px;
    height: 150px;
  }
  .box_Title_Text {
    font-size: 15px;
    color: #808080;
    font-weight: 600;
    margin: 10px 0;
  }
  .box_Content_Text {
    font-size: 13px;
    text-indent: 2em;
    color: #adadad;
    font-weight: 500;
    line-height: 17px;

  }

}

</style>
